package com.sqly.doc;


import android.annotation.SuppressLint;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sqly.doc.user.bleequip_list;
import com.sqly.doc.user.servercepack_list;
import com.sqly.doc.user.team_gl_list;
import com.sqly.doc.user.team_list;
import com.sqly.doc.util.SharedPreferencesUtils;

//import cn.pedant.SweetAlert.SweetAlertDialog;


@SuppressLint("NewApi")
public class wd_fragment extends Fragment {

    LinearLayout myteam;//我的团队
    LinearLayout teams;//团队管理
    LinearLayout packs;//服务包管理
    LinearLayout sbgl;//蓝牙设备管理
    TextView myname;
    View fwbview, teamview;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        View view = inflater.inflate(R.layout.wd_fragment, null);
        myname = (TextView) view.findViewById(R.id.myname);
        myname.setText(SharedPreferencesUtils.getParam(getActivity(),"uname","").toString());
        myteam = (LinearLayout) view.findViewById(R.id.myteam);
        teams = (LinearLayout) view.findViewById(R.id.teams);
        packs = (LinearLayout) view.findViewById(R.id.packs);
        sbgl = (LinearLayout) view.findViewById(R.id.sbgl);
        fwbview = (View) view.findViewById(R.id.fwb_view);
        teamview = (View) view.findViewById(R.id.team_view);

        if(SharedPreferencesUtils.getParam(getActivity(),"isxzgly","").toString().equals("true")) {
            teams.setVisibility(View.GONE);
            packs.setVisibility(View.GONE);
            fwbview.setVisibility(View.GONE);
            teamview.setVisibility(View.GONE);
        }else {
            teams.setVisibility(View.GONE);
            packs.setVisibility(View.GONE);
            fwbview.setVisibility(View.GONE);
            teamview.setVisibility(View.GONE);
        }
        myteam.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),team_list.class));
            }
        });

        teams.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),team_gl_list.class));
            }
        });

        packs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),servercepack_list.class));
            }
        });

        sbgl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(), bleequip_list.class));
            }
        });
        return view;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onActivityCreated(savedInstanceState);


    }

}
